<template>
  <el-dialog
    @close="close"
    title="提现动态"
    :visible.sync="dialog"
    width="40%"
  >
    <el-form size="mini" :model="formInline" :rules="rules" ref="formInline" label-width="100px">
      <el-form-item label="流水号：">
        {{formInline.serialNo}}
      </el-form-item>

      <el-form-item label="提现状态：">
        <el-tag v-if="formInline.status == 0">待审核</el-tag>
        <el-tag v-else-if ="formInline.status == 1">已通过</el-tag>
        <el-tag v-else-if="formInline.status == 2">已拒绝</el-tag>
      </el-form-item>

      <el-form-item label="提现平台：">
        <!--<el-tag v-if="formInline.withdrawType == 1">支付宝</el-tag>
        <el-tag v-else-if="formInline.withdrawType == 2">{{formInline.bankType}}</el-tag>-->
        {{formInline.bankType}}
      </el-form-item>

      <el-form-item label="提现账户：">
        {{formInline.cashAccount}}
      </el-form-item>

      <el-form-item label="收款人：">
        {{formInline.realName}}
      </el-form-item>

      <el-form-item label="预留手机号：">
        {{formInline.smsCode}}
      </el-form-item>

      <el-form-item label="交易时间：">
        {{formInline.updateTime}}
      </el-form-item>

    </el-form>
  </el-dialog>

</template>
<script>
  import { getDynamicDetailAPI} from '@/api/user'

  export default {
    name: 'DetailWithdraw',
    props: {
      dialog_: {
        type: Boolean,
        default: false
      },
      id: {
        type: Number,
        default: null
      },
      model: {  // 编辑传入的对象
        default: null,
        type: Object
      }
    },
    data() {
      return {
        dialog: false,
        formInline: {
          id:'',
          title:'',
          content:'',
          link:'',
          kind:5
        },
        btnLoading: false,
      }
    },
    methods: {
      close() {
        this.$emit('close')
      },
      // 提交
      getDetail() {
        this.btnLoading = true
        let param = {
          id:this.model.id
        }
        getDynamicDetailAPI(param).then(res => {
          this.btnLoading = false
          if (res.rtnInfo.code === 0) {
           this.formInline = res.rtnInfo.data
          } else {
            this.$message.error(res.message)
          }
        })
      },
    },
    mounted() {
      this.dialog = this.dialog_
      /*if (this.model != '' && this.model != null){
        this.formInline = this.model
      }*/
      this.getDetail()
    }
  }
</script>
